package org.zcj.util;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;

public class JSONStringUtil {
	// 字符串解析为map
	public static Map<String, Object> stringToJson(String json) {
		Map<String, Object> map = new HashMap<String, Object>();

		String json2 = "[" + json + "]";
		List<Map<String, Object>> listMap = JSON.parseObject(json2,
				new TypeReference<List<Map<String, Object>>>() {
				});
		String json3 = "[" + listMap.get(0).get("requestparams") + "]";
		List<Map<String, Object>> listMap2 = JSON.parseObject(json3,
				new TypeReference<List<Map<String, Object>>>() {
				});
		map = listMap2.get(0);
		return map;
	}
}
